﻿using FR.SAFTAnalyser.ViewModels;
using FR.SAFTAnalyser.ViewModels.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace FR.SAFTAnalyser.ValueConverters
{
    public class ActiveDocumentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is SaftViewModel)
                return value;
            if (value is CustomersViewModel)
                return value;
            if (value is GeneralLedgerViewModel)
                return value;
            if (value is GeneralLedgerEntriesViewModel)
                return value;
            if (value is HeaderViewModel)
                return value;
            if (value is InvoicesSummaryViewModel)
                return value;
            if (value is InvoicesViewModel)
                return value;
            if (value is ProdutsViewModel)
                return value;
            if (value is SupplierViewModel)
                return value;
            if (value is TaxViewModel)
                return value;

            if (value is ConvertPemKeyViewModel)
                return value;
            if (value is ErrorMessagesViewModel)
                return value;

            if (value is StockHeaderViewModel)
                return value;

            if (value is StocksProductsViewModel)
                return value;

            return Binding.DoNothing;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is SaftViewModel)
                return value;
            if (value is CustomersViewModel)
                return value;
            if (value is GeneralLedgerViewModel)
                return value;
            if (value is GeneralLedgerEntriesViewModel)
                return value;
            if (value is HeaderViewModel)
                return value;
            if (value is InvoicesSummaryViewModel)
                return value;
            if (value is InvoicesViewModel)
                return value;
            if (value is ProdutsViewModel)
                return value;
            if (value is SupplierViewModel)
                return value;
            if (value is TaxViewModel)
                return value;

            if (value is ConvertPemKeyViewModel)
                return value;
            if (value is ErrorMessagesViewModel)
                return value;

            if (value is StockHeaderViewModel)
                return value;
            if (value is StocksProductsViewModel)
                return value;

            return Binding.DoNothing;
        }
    }
}
